package com.bioroadlab.pojo;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

/**
 * DiseaseCategory entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "disease_category", catalog = "bioroadlab")
public class DiseaseCategory implements java.io.Serializable {

	// Fields

	private static final long serialVersionUID = 1L;

	private Integer sn;
	private String name;
	private Set<DiseaseType> diseaseTypes = new HashSet<DiseaseType>(0);

	@TableGenerator(table = "id_generator", pkColumnName = "name", pkColumnValue = "DiseaseCategory", valueColumnName = "id", initialValue = 109, allocationSize = 1, name = "generator")
	@Id
	@GeneratedValue(generator = "generator", strategy = GenerationType.TABLE)
	@Column(name = "sn", unique = true, nullable = false)
	public Integer getSn() {
		return this.sn;
	}

	public void setSn(Integer sn) {
		this.sn = sn;
	}

	@Column(name = "name", length = 20)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "diseaseCategory")
	public Set<DiseaseType> getDiseaseTypes() {
		return this.diseaseTypes;
	}

	public void setDiseaseTypes(Set<DiseaseType> diseaseTypes) {
		this.diseaseTypes = diseaseTypes;
	}

}